home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_pool.cog < prev    next >
Text File  |  1999-11-15  |  9KB  |  200 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_Pool.cog
  4. #
  5. # Pool door puzzle in Teotihuacan
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     activate                             
  16.                                                      
  17.     thing       keypos                               
  18.     template    keytemplate
  19.     sound       keysound
  20.     sound       gurgling
  21.     sound       columnrise=mus_teo_statuerise.wav    local
  22.     
  23.     thing       indyactor                   local
  24.     thing       indyactorkey    
  25.     template    actortemplate
  26.     thing       actorpos
  27.     keyframe    in_placekey=in_activate_medium.key      local
  28.     keyframe    in_activate=in_uw_pullswitch.key        local                             
  29.                                                      
  30.     thing       wallSwitch                  local        
  31.     thing       keyhole                              
  32.     thing       fishSwitch                           
  33.     thing       stoneBar0                            
  34.     thing       stoneBar1                            
  35.                                                      
  36.     thing       stonePlug0                           
  37.     thing       stonePlug1                           
  38.     thing       stonePlug2
  39.     
  40.     thing       woodColumn                           
  41.                                                      
  42.     thing       keycamera       
  43.     thing       actorcam
  44.     thing       plugCam
  45.     thing       stoneBarCam
  46.     thing       woodColumnCam
  47.     thing       tgt_Col
  48.     thing       player                      local                
  49.                                                      
  50.     int         flag=0                      local                
  51.     int         keycheck=0                  local                
  52.     int         stonebarchan                local                
  53.     int         moveSpeed=1 
  54.     int         wepnum=1                    local
  55.     int         lastrand=-1                 local
  56.     int         currand=0                   local
  57.     
  58.     flex        camTime                              
  59.     flex        camSpeed 
  60.     
  61.     sound       indylineb0=inxj058.wav      local
  62.     sound       indylineb1=inxj059.wav      local
  63.     sound       indylineb2=inxj060.wav      local
  64.     sound       indylineb3=inxj061.wav      local
  65.     sound       indylineb4=inxj090.wav      local
  66.     sound       indylineb5=inxj095.wav      local                            
  67.     
  68. end                                              
  69.  
  70. code
  71.  
  72. # ........................................................................................
  73. startup:
  74.  
  75.     player = GetLocalPlayerThing();    
  76.     
  77. return;                            
  78.  
  79. # ........................................................................................        
  80. activate:
  81.  
  82.     if ((GetSenderRef() == keyhole) && (GetCurItem(player) == 55) &&         
  83.         (flag == 0))                                                         
  84.     {
  85.         StartCutscene(1);
  86.         SetActorFlags(player, 0x200000);
  87.         SetThingFlags(player, 0x80000);
  88.         flag = 1;
  89.         SetCameraFocus(0, keycamera);                                                          
  90.         SetCurrentCamera(0);
  91.         CopyPlayerHolsters(player, indyactorkey);
  92.         ClearThingFlags(indyactorkey, 0x80000);
  93.         PlayKey(indyactorkey, in_placekey, 4, 0x12, 0);
  94.         sleep(0.25);                                                                    
  95.         wallSwitch = CreateThing(keytemplate, keypos);                          
  96.         CaptureThing(wallSwitch);                                            
  97.         ChangeInv(player, 55, -1);
  98.         MoveToFrame(wallSwitch, 1, 1);
  99.         MoveToFrame(keypos, 1, 1);
  100.         WaitForStop(wallSwitch);                                     
  101.         PlaySoundLocal(keysound, 1, 0, 0, 1);
  102.         sleep(1);
  103.         MoveToFrame(stoneBar0, 1, moveSpeed);                                             
  104.         MoveToFrame(stoneBar1, 1, moveSpeed);   
  105.         SetCameraFocus(0, stoneBarCam);
  106.         SetCurrentCamera(0);                                                       
  107.         MoveToFrame(stoneBarCam, 1, camSpeed);
  108.         WaitForStop(stoneBarCam);
  109.         DestroyThing(indyactorkey);
  110.         sleep(1);
  111.         SetCurrentCamera(1);
  112.         ClearActorFlags(player, 0x200000);
  113.         ClearThingFlags(player, 0x80000);
  114.         EndCutscene();
  115.     }
  116.     
  117.     if ((GetSenderRef() == keyhole) &&
  118.         ((GetCurItem(player) != 55) || (GetCurWeapon(player) != 0)) &&
  119.         (flag == 0))
  120.     {
  121.         StopThing(player);
  122.         StartCutscene(1);
  123.         SetActorFlags(player, 0x200000);
  124.         currand = RandBetween(0, 5);
  125.         While (lastrand == currand)
  126.         {
  127.             currand = RandBetween(0, 5);
  128.         }
  129.         PlayVoice(player, indylineb0[currand], 1, 1);
  130.         lastrand = currand;
  131.         EndCutscene();
  132.         ClearActorFlags(player, 0x200000);
  133.     }                                                                        
  134.                                                                              
  135.     if ((GetSenderRef() == fishSwitch) && (flag == 1) && (GetCurItem(player) == 0))                                  
  136.                                                                 
  137.     {
  138.         While(wepnum !=0)
  139.         {
  140.             wepnum = GetCurWeapon(player);
  141.             DeselectWeaponWait(player);
  142.             DeselectWeapon(player);
  143.         }
  144.         //print("hit underwater switch");
  145.         flag=2;
  146.         StartCutscene(1);   
  147.         SetActorFlags(player, 0x200000);                        //shut off controls                                                                        
  148.         SetThingFlags(player, 0x80000);                         //shut off vis
  149.         indyactor = CreateThing(actortemplate, actorpos);       //create stuntman
  150.         CaptureThing(indyactor);                                //
  151.         SetCameraFocus(0, actorcam);                            //camera shot of indy pulling switch
  152.         SetCurrentCamera(0);
  153.         ClearThingFlags(indyactor, 0x80000);
  154.         //SetThingTimer(fishSwitch, 1.5);
  155.         CopyPlayerHolsters(player, indyactor);
  156.         PlayKey(indyactor, in_activate, 4, 0x12, 0);
  157.         sleep(1);
  158.         MoveToFrame(fishSwitch, 1, 0.35);
  159.         sleep(1);                                               
  160.         SetCameraFocus(0, plugCam);
  161.         SetCurrentCamera(0);
  162.         SetCameraFOV(100, 0, 0);
  163.         Sleep(0.8);                                                                              
  164.         RotatePivot(plugCam, 1, 4);                             //spin camera around column                          
  165.         MoveToFrame(stonePlug0, 1, moveSpeed);                  //move stone plugs                          
  166.         sleep(1.5);                                                                       
  167.         MoveToFrame(stonePlug1, 1, moveSpeed);                                            
  168.         sleep(1.5);                                                                       
  169.         MoveToFrame(stonePlug2, 1, moveSpeed);                                            
  170.         sleep(2.5);
  171.         //play gurgling noise
  172.         PlaySoundThing(gurgling, woodColumn, 1, 5, 10, 0x80);
  173.         PlaySoundLocal(columnrise, 1, 0, 0, 0);
  174.         //cut to column camera
  175.         SetCameraFocus(2, woodColumnCam);
  176.         SetCameraSecondaryFocus(2, tgt_Col);
  177.         SetCurrentCamera(2);
  178.         SetCameraFOV(100, 0, 0);
  179.         MoveToFrame(woodColumn, 1, 1);
  180.         MoveToFrame(tgt_Col, 1, 1);
  181.         WaitForStop(woodColumn);
  182.         Sleep(1);
  183.         SetCurrentCamera(1);
  184.         SetCameraFOV(90, 0, 0);                                 //reset camera to player
  185.         SetThingFlags(indyactor, 0x80000);                      //shut off vis on stuntman
  186.         DestroyThing(indyactor);                                //destroy the stuntman
  187.         ClearThingFlags(player, 0x80000);                       //turn on player vis
  188.         ClearActorFlags(player, 0x200000);                      //return control to player
  189.         wepnum = 1;
  190.         EndCutScene();                                                           
  191.     }
  192.     
  193.     return;                                                                  
  194.         
  195. # ........................................................................................
  196.                 
  197. end
  198.  
  199.  
  200.